{% extends 'layout.html' %}{# 继承之母板layout #}

{% block content %}


        <div style="margin-bottom: 10px">{# 跟下面距离10个象素 #}
            <a class="btn btn-success" href="/city/add/">{# 绿色success #}{# 在新页面打开target="_blank" #}
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>{# 新建部门 #}
                新建城市
            </a>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>{# 在部门列表前加图标 #}
                城市列表
            </div>
            <div class="panel-body">
                <table class="table table-bordered table-striped ">{# 带边宽,带条纹 #}
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>logo</th>
                        <th>名称</th>
                        <th>人口</th>

                    </tr>
                    </thead>
                    <tbody>
                    {# 从视图函数那里获取queryset列表 #}
                    {% for obj in queryset %}
                        <tr>
                            {# 循环取得列表内容 #}
                            <td>{{ obj.id }}</td>
                            <td>
                                <img src="/media/{{ obj.img }}" alt="" style="height:80px">

                            </td>
                            <td>{{ obj.name }}</td>
                            <td>{{ obj.count }}</td>


                        </tr>
                    {% endfor %}

                    </tbody>
                </table>

            </div>
            <ul class="pagination" style="float: left">
                {{ page_string }}
            </ul>
        </div>

    </div>



{% endblock %}

























